﻿using NLog;
using System;

namespace Configuration.ServerApi
{
    /// <summary>
    /// NLog 日志记录类
    /// </summary>
    public sealed class NLog
    {
        private static Logger _logger = LogManager.GetCurrentClassLogger();

        /// <summary>
        /// Trace
        /// </summary>
        /// <param name="strMsg"></param>
        public static void Trace(string strMsg)
        {
            _logger.Trace(strMsg);
        }

        /// <summary>
        /// Trace
        /// </summary>
        /// <param name="e"></param>
        /// <param name="strMsg"></param>
        public static void Trace(Exception e, string strMsg)
        {
            _logger.Trace(e, strMsg);
        }

        /// <summary>
        /// Debug
        /// </summary>
        /// <param name="strMsg"></param>
        public static void Debug(string strMsg)
        {
            _logger.Debug(strMsg);
        }

        /// <summary>
        /// Info
        /// </summary>
        /// <param name="strMsg"></param>
        public static void Info(string strMsg)
        {
            _logger.Info(strMsg);
        }

        /// <summary>
        /// Warn
        /// </summary>
        /// <param name="strMsg"></param>
        public static void Warn(string strMsg)
        {
            _logger.Warn(strMsg);
        }

        /// <summary>
        /// Warn
        /// </summary>
        /// <param name="e"></param>
        public static void Warn(Exception e)
        {
            _logger.Warn(e);
        }

        /// <summary>
        /// Warn
        /// </summary>
        /// <param name="e"></param>
        /// <param name="strMsg"></param>
        public static void Warn(Exception e, string strMsg)
        {
            _logger.Warn(e, strMsg);
        }

        /// <summary>
        /// Error
        /// </summary>
        /// <param name="strMsg"></param>
        public static void Error(string strMsg)
        {
            _logger.Error(strMsg);
        }

        /// <summary>
        /// Error
        /// </summary>
        /// <param name="e"></param>
        /// <param name="strMsg"></param>
        public static void Error(Exception e, string strMsg)
        {
            _logger.Error(strMsg);
        }

        /// <summary>
        /// Error
        /// </summary>
        /// <param name="e"></param>
        public static void Error(Exception e)
        {
            _logger.Error(e);
        }

        /// <summary>
        /// Fatal
        /// </summary>
        /// <param name="strMsg"></param>
        public static void Fatal(string strMsg)
        {
            _logger.Fatal(strMsg);
        }

    }
}
